package com.bsoft.exchange.dao.his;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import com.bsoft.exchange.domain.*;
import org.apache.ibatis.annotations.Param;

import com.bsoft.exchange.pojo.SyncOrderStatePoJo;

public interface AppointmentMapper {

	public List<SyncOrderState> syncOrderState (SyncOrderStatePoJo syncOrderStatePoJo);

	/**
	 * 获取病人再黑名单中是否有记录
	 * @param brid
	 * @param jgid
	 * @return
	 */
	Integer getMdbz(@Param("brid")String brid,@Param("jgid")String jgid)throws SQLException;
	/**
	 * 通过身份证号获取病人ID
	 * @param sfzh
	 * @return
	 */
	PatientInfoDomain getBridSfzh(@Param("sfzh")String sfzh)throws SQLException;
	/**
	 * 校验brid
	 * @param brid
	 * @return
	 */
	Integer getBridBrda(@Param("brid")int brid)throws SQLException;
	/**
	 * 获取该病人是否可以预约
	 * @param brid
	 * @param jgid
	 * @return
	 */
	GHHMD getIsYY(@Param("brid")String brid, @Param("jgid")String jgid)throws SQLException;

	/**
	 * 更新病人黑名单中的状态
	 * @param brid
	 * @param jgid
	 * @return
	 */
	Integer updateBrzt(@Param("brid")String brid,@Param("jgid")String jgid)throws SQLException;

	/**
	 * 查询号源是否被使用
	 */
	HYXX getHyxx(@Param("jlxh")String jlxh,@Param("jgid")String jgid)throws SQLException;

	/**
	 * 挂号预约保存
	 * @param YYXH 预约序号
	 * @param JGID
	 * @param BRID
	 * @param BRXM
	 * @param SFZH 身份证号
	 * @param LXDH 联系电话
	 * @param HYXH 号源序号
	 * @param YYTJ 预约途径
	 * @return
	 * @throws SQLException
	 */
	Integer insertGHYY(@Param("YYXH")long YYXH,@Param("JGID")String JGID,@Param("BRID")String BRID,@Param("BRXM")String BRXM,
					   @Param("BRXB")Integer BRXB,@Param("SFZH")String SFZH,@Param("LXDH")String LXDH,@Param("HYXH")String HYXH,
					   @Param("YYTJ")Integer YYTJ,@Param("YYSJ") Date YYSJ)throws SQLException;


	Integer insertYYXX(@Param("YYXH")long YYXH,@Param("JGID")String JGID,@Param("BRID")String BRID,@Param("BRXM")String BRXM,
					   @Param("BRXB")Integer BRXB,@Param("SFZH")String SFZH,@Param("LXDH")String LXDH,@Param("HYXH")String HYXH,
					   @Param("YYTJ")Integer YYTJ,@Param("YYSJ") Date YYSJ,@Param("applx") Integer applx,@Param("ghxh") Long ghxh,
					   @Param("appwzlx") String appwzlx,@Param("appzxzj") String appzxzj,@Param("apphzbq") String apphzbq);

	Integer updateHyxx(@Param("yyxh")long yyxh,@Param("brid")String brid,@Param("brxm")String brxm,@Param("jlxh")String jlxh,@Param("jgid")String jgid)throws SQLException;

	Integer updateHYXX(@Param("jlxh") Long jlxh,@Param("brid")String brid,@Param("brxm")String brxm,@Param("ghxh") Long ghxh);

	BookingRegisterDomain getAddress(@Param("ygdm")String ygdm,@Param("ksdm")String ksdm,@Param("jgid")String jgid)throws SQLException;

	/**
	 * 根据身份证查询用户的医保卡号
	 * @param userId 身份证号码
	 * @return 医保卡号
	 */
	String getYbkh(@Param("userId") String userId);

	Integer insertMzlsh(@Param("userId") String userId,@Param("lsh") String lsh);

	String getMzlsh(@Param("userId") String userId);

	List<HyxxDomain> getSXh(@Param("jgid") Integer jgid,@Param("ghks") String ghks,@Param("gzrq") Date gzrq,@Param("ysdm") String ysdm,@Param("zblb") Integer zblb);

	Integer getGhlb(@Param("ksdm") String ksdm);
}
